//
//  MainViewController.m
//  CoreAnimation
//
//  Created by 张国文 on 16/10/10.
//  Copyright © 2016年 hangzhouyijiyin. All rights reserved.
//


#import "MainViewController.h"
#import "GuestImageViewController.h"
#import "FirstChapterViewController.h"
#import "SecondChapterViewController.h"
#import "ThirdChaperViewController.h"
#import "SuperNavigationViewController.h"
#import "FourthChapterViewController.h"
#import "FivethChapterViewController.h"
#import "SixedChapterViewController.h"
#import "SevenChapterViewController.h"
#import "EightChapterViewController.h"
#import "NinethChapterViewController.h"
#import "TenthChapterViewController.h"
#import "ElevenChapterViewController.h"
#import "TwelveChapterViewController.h"

@interface MainViewController ()

@end

@implementation MainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    self.view.backgroundColor = [UIColor whiteColor];
    NSLog(@"name=%@", NSLocalizedString(@"name", @"这是一句注解，根据情况写"));
    NSUserDefaults *defau = [NSUserDefaults standardUserDefaults];
    NSArray *languages = [defau valueForKey:@"AppleLanguages"];
    NSLog(@"所支持的语言：%@", languages);
    
    NSString *currentLanguage = [[NSLocale preferredLanguages] firstObject];
    NSLog(@"当前的语言：%@", currentLanguage);
    
    [self.navigationController.navigationBar setTranslucent:NO];
    
    UIButton *firstButton = [UIButton buttonWithType:UIButtonTypeCustom];
    firstButton.frame = CGRectMake(0, 20, 200, 50);
    [firstButton setTitle:@"寄宿图-第一章" forState:UIControlStateNormal];
    [firstButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    firstButton.tag = 100;
    [firstButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:firstButton];
    
    UIButton *sectionButton = [UIButton buttonWithType:UIButtonTypeCustom];
    sectionButton.frame = CGRectMake(0, 70, 200, 50);
    [sectionButton setTitle:@"图形几何学-第二章" forState:UIControlStateNormal];
    [sectionButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    sectionButton.tag = 101;
    [sectionButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:sectionButton];
    
    UIButton *thirdButton = [UIButton buttonWithType:UIButtonTypeCustom];
    thirdButton.frame = CGRectMake(0, 120, 200, 50);
    [thirdButton setTitle:@"Layer视觉效果-第三章" forState:UIControlStateNormal];
    [thirdButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    thirdButton.tag = 102;
    [thirdButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:thirdButton];
    
    UIButton *fourthButton = [UIButton buttonWithType:UIButtonTypeCustom];
    fourthButton.frame = CGRectMake(0, 170, 200, 50);
    [fourthButton setTitle:@"Layer的位置变换-第四章" forState:UIControlStateNormal];
    [fourthButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    fourthButton.tag = 103;
    [fourthButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:fourthButton];
    
    UIButton *fivethButton = [UIButton buttonWithType:UIButtonTypeCustom];
    fivethButton.frame = CGRectMake(0, 220, 200, 50);
    [fivethButton setTitle:@"专用图层-第五章" forState:UIControlStateNormal];
    [fivethButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    fivethButton.tag = 104;
    [fivethButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:fivethButton];
    
    UIButton *sixthButton = [UIButton buttonWithType:UIButtonTypeCustom];
    sixthButton.frame = CGRectMake(0, 270, 200, 50);
    [sixthButton setTitle:@"隐式动画-第六章" forState:UIControlStateNormal];
    [sixthButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    sixthButton.tag = 105;
    [sixthButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:sixthButton];
    
    UIButton *seventhButton = [UIButton buttonWithType:UIButtonTypeCustom];
    seventhButton.frame = CGRectMake(0, 320, 200, 50);
    [seventhButton setTitle:@"显式动画-第七章" forState:UIControlStateNormal];
    [seventhButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    seventhButton.tag = 106;
    [seventhButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:seventhButton];
    
    UIButton *eighthButton = [UIButton buttonWithType:UIButtonTypeCustom];
    eighthButton.frame = CGRectMake(0, 370, 200, 50);
    [eighthButton setTitle:@"图层时间-第八章" forState:UIControlStateNormal];
    [eighthButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    eighthButton.tag = 107;
    [eighthButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:eighthButton];
    
    UIButton *nineButton = [UIButton buttonWithType:UIButtonTypeCustom];
    nineButton.frame = CGRectMake(0, 420, 200, 50);
    [nineButton setTitle:@"动画速度-第九章" forState:UIControlStateNormal];
    [nineButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    nineButton.tag = 108;
    [nineButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:nineButton];
    
    UIButton *tenthButton = [UIButton buttonWithType:UIButtonTypeCustom];
    tenthButton.frame = CGRectMake(0, 470, 200, 50);
    [tenthButton setTitle:@"定时帧-第十章" forState:UIControlStateNormal];
    [tenthButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    tenthButton.tag = 109;
    [tenthButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:tenthButton];
    
    UIButton *elevenButton = [UIButton buttonWithType:UIButtonTypeCustom];
    elevenButton.frame = CGRectMake(0, 520, 200, 50);
    [elevenButton setTitle:@"高效绘图-第十一章" forState:UIControlStateNormal];
    [elevenButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    elevenButton.tag = 110;
    [elevenButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:elevenButton];
    
    UIButton *twelveButton = [UIButton buttonWithType:UIButtonTypeCustom];
    twelveButton.frame = CGRectMake(200, 20, 170, 50);
    [twelveButton setTitle:@"图层性能-第十二章" forState:UIControlStateNormal];
    [twelveButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    twelveButton.tag = 111;
    [twelveButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:twelveButton];
}

- (void)clickJump:(UIButton *)button
{
    switch (button.tag) {
        case 100:
        {
            FirstChapterViewController *firstChapterVC = [[FirstChapterViewController alloc] init];
            [self.navigationController pushViewController:firstChapterVC animated:YES];
            break;
        }
        case 101:
        {
            SecondChapterViewController *secondChapterVC = [[SecondChapterViewController alloc] init];
            [self.navigationController pushViewController:secondChapterVC animated:YES];
            break;
        }
        case 102:
        {
            ThirdChaperViewController *thirdChapterVC = [[ThirdChaperViewController alloc] init];
            [self.navigationController pushViewController:thirdChapterVC animated:YES];
            
            break;
        }
            case 103:
        {
            FourthChapterViewController *fourthChapterVC = [[FourthChapterViewController alloc] init];
            [self.navigationController pushViewController:fourthChapterVC animated:YES];
            break;
        }
            case 104:
        {
            FivethChapterViewController *fiveChapterVC = [[FivethChapterViewController alloc] init];
            [self.navigationController pushViewController:fiveChapterVC animated:YES];
            break;
        }
            case 105:
        {
            SixedChapterViewController *sixedChapterVC = [[SixedChapterViewController alloc] init];
            [self.navigationController pushViewController:sixedChapterVC animated:YES];
            break;
        }
            case 106:
        {
            SevenChapterViewController *sevenChapterVC = [[SevenChapterViewController alloc] init];
            [self.navigationController pushViewController:sevenChapterVC animated:YES];
            break;
        }
            case 107:
        {
            EightChapterViewController *eightChapterVC = [[EightChapterViewController alloc] init];
            [self.navigationController pushViewController:eightChapterVC animated:YES];
            break;
        }
            case 108:
        {
            NinethChapterViewController *ninethChapterVC = [[NinethChapterViewController alloc] init];
            [self.navigationController pushViewController:ninethChapterVC animated:YES];
            break;
        }
            case 109:
        {
            TenthChapterViewController *tenChapterVC = [[TenthChapterViewController alloc] init];
            [self.navigationController pushViewController:tenChapterVC animated:YES];
            break;
        }
            case 110:
        {
            ElevenChapterViewController *elevenChapterVC = [[ElevenChapterViewController alloc] init];
            [self.navigationController pushViewController:elevenChapterVC animated:YES];
            break;
        }
            case 111:
        {
            TwelveChapterViewController *twelveChapterVC = [[TwelveChapterViewController alloc] init];
            [self.navigationController pushViewController:twelveChapterVC animated:YES];
            break;
        }
        default:
            break;
    }
}




@end
